package Learning;

import java.util.*;               

// This class models a photo with an id and a list of keywords

/**
 *
 * @author Madhava Carrillo <madhava at me.com>
 */
public class Photo {

	private String id;
	private ArrayList<String> keywords;
	
    /**
     *
     */
    public Photo() {
		id = "";
		keywords = new ArrayList<String>();
	}
	
    /**
     *
     * @param k
     */
    public void addKeyword(String k) {
		keywords.add(k);
	}

    /**
     *
     * @param i
     */
    public void setId(String i) {
		id = i;
	}

    /**
     *
     * @return
     */
    public String getId() {
		return id;
	}
	
    /**
     *
     * @return
     */
    public String toString() {
		String res = "ID: " + id + "\n";
		for(Iterator iterator = keywords.iterator(); iterator.hasNext();) {
		    res = res + "\t Keyword: " + (String)iterator.next() + "\n";
		}
		return res;
	}
	
}	

